//
//  BarCodeDetailsViewController.m
//  WeiBao
//
//  Created by macbook on 16/5/30.
//  Copyright © 2016年 ucox. All rights reserved.
//

#import "BarCodeDetailsViewController.h"
#import "BarCodeView.h"
#import "BarCodeViewController.h"
@interface BarCodeDetailsViewController ()<UIWebViewDelegate>

@end

@implementation BarCodeDetailsViewController

- (void)viewDidLoad
{
    [super viewDidLoad];
    
    self.title = @"二维码/条形码详情";
    
    UIImageView *codeImageView = [[UIImageView alloc]initWithFrame:CGRectMake(0, 64, 136, 136)];
    
    codeImageView.image = _codeImage;
    
    codeImageView.contentMode = UIViewContentModeScaleAspectFit;
    
    [self.view addSubview:codeImageView];
    
    
    
    self.mainWebView = [[UIWebView alloc]initWithFrame:CGRectMake(0, 200, ScreenWidth, ScreenHeight-200)];
    
    [self.view addSubview:self.mainWebView];
    
    self.mainWebView.delegate = self;
    
    if ([self.dataString rangeOfString:@"http"].location != NSNotFound)
    {
        [self.mainWebView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:self.dataString]]];
    }
    else
    {
        [self.mainWebView loadHTMLString:self.dataString baseURL:nil];
    }
    
    // Do any additional setup after loading the view.
}
-(void)webViewDidStartLoad:(UIWebView *)webView
{
//    [self.view makeToastActivitywithMessage:@"加载中..."];
}

-(void)webViewDidFinishLoad:(UIWebView *)webView
{
//    [self.view hideToastActivity];
    
    if ([self.dataString rangeOfString:@"http"].location != NSNotFound)
    {
//        [self setNavBarTitleStr:[webView stringByEvaluatingJavaScriptFromString:@"document.title"]];
    }
    else
    {
//        [self setNavBarTitleStr:@"二维码数据"];
    }
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
